import React, { Component, Fragment } from 'react';
import { connect } from 'react-redux';
import { Navigate } from 'react-router-dom';
class Writer extends Component {
  render() {
    if (this.props.loginStatus) {
      return (
        <Fragment>
          <div>写文章页面具体内容</div>
        </Fragment>
      )
    } else {
      return <Navigate to="/login" />
    }
  }
}
const mapState = (state) => ({
  loginStatus: state.getIn(['login', 'loginStatus'])
})
export default connect(mapState, null)(Writer);